//
//  BCVideoChatVC.m
//  BananaChat
//
//  Created by 于洪东 on 2019/11/1.
//  Copyright © 2019 香蕉. All rights reserved.
//

#import "BCVideoChatVC.h"
#import "BCVideoListVC.h"
#import "BCRecommendListVC.h"

#define bc_menu_item_height 30*ScaleX
#define bc_menu_item_width  80*ScaleX

@interface BCVideoChatVC ()

@property (nonatomic,strong) NSMutableArray *titleArray;

@end

@implementation BCVideoChatVC

#pragma mark - ♻️life cycle

-(instancetype)init{
    if (self = [super init]) {
        self.titleSizeNormal = 18*ScaleX;
        self.titleSizeSelected = 18*ScaleX;
        self.menuViewStyle = WMMenuViewStyleLine;
        self.menuItemWidth = bc_menu_item_width;
        self.progressWidth = 20*ScaleX;
        self.progressColor = NTMainColor;
        self.titleColorNormal = NTBlackColor;
        self.titleColorSelected = NTMainColor;
    }
    return self;
}


- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    [self setupUI];
}


#pragma mark - 🔄overwrite

#pragma mark - 🚪public

#pragma mark - 🍐delegate

-(NSInteger)numbersOfChildControllersInPageController:(WMPageController *)pageController{
    return self.titleArray.count;
}

-(UIViewController *)pageController:(WMPageController *)pageController viewControllerAtIndex:(NSInteger)index{
    if (index == 0) {
        BCRecommendListVC *listVC = [[BCRecommendListVC alloc]init];
        return listVC;
    }
    BCVideoListVC *listVC = [[BCVideoListVC alloc]init];
    return listVC;
}

-(NSString *)pageController:(WMPageController *)pageController titleAtIndex:(NSInteger)index{
    return self.titleArray[index];
}

-(CGRect)pageController:(WMPageController *)pageController preferredFrameForMenuView:(WMMenuView *)menuView{
    
    CGFloat menuWidth = self.titleArray.count * bc_menu_item_width;
    
    return CGRectMake(0, NAV_BAR_HEIGHT + 10*ScaleX, menuWidth, bc_menu_item_height);
}

-(CGRect)pageController:(WMPageController *)pageController preferredFrameForContentView:(WMScrollView *)contentView{
    
    CGFloat y = NAV_BAR_HEIGHT + bc_menu_item_height + 20*ScaleX;
    
    return CGRectMake(0, y , SCREEN_WIDTH, SCREEN_HEIGHT - y - TAB_BAR_HEIGHT);
}

#pragma mark - ☎️notification

#pragma mark - 🎬event response

#pragma mark - 🔒private

#pragma mark - 🌲setupUI
-(void)setupUI{
    self.view.backgroundColor = NTBackGroundColor;
    self.menuView.backgroundColor = NTBackGroundColor;
    
}

#pragma mark - ☸getter and setter

-(NSMutableArray *)titleArray{
    if (_titleArray == nil) {
        _titleArray = [NSMutableArray arrayWithArray:@[@"推荐",@"在线女生",@"萌新"]];
    }
    return _titleArray;
}

@end
